package org.shangrila.wfm.eo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the WFM_SERVICE database table.
 * 
 */
@Entity
@Table(name="WFM_SERVICE")
@NamedQuery(name="WfmService.findAll", query="SELECT w FROM WfmService w")
public class WfmService implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	@Column(name="CREATE_TIME")
	private String createTime;

	private String creator;

	@Column(name="CURRENT_NODE_NAME")
	private String currentNodeName;

	@Column(name="EXPIRE_TIME")
	private String expireTime;

	@Column(name="LAST_UPDATE_TIME")
	private String lastUpdateTime;

	@Column(name="LAST_UPDATOR")
	private String lastUpdator;

	@Column(name="PARENT_ID")
	private String parentId;

	@Column(name="PARENT_NODE_NAME")
	private String parentNodeName;

	private int priority;

	@Column(name="SERVICE_NO")
	private String serviceNo;

	@Column(name="\"VARIABLE\"")
	private String variable;

	@Column(name="\"VERSION\"")
	private int version;

	//bi-directional many-to-one association to WfmProcess
	@ManyToOne
	@JoinColumn(name="PROCESS_ID")
	private WfmProcess wfmProcess;

	//bi-directional many-to-one association to WfmTask
	@OneToMany(mappedBy="wfmService")
	private List<WfmTask> wfmTasks;

	public WfmService() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public String getCurrentNodeName() {
		return this.currentNodeName;
	}

	public void setCurrentNodeName(String currentNodeName) {
		this.currentNodeName = currentNodeName;
	}

	public String getExpireTime() {
		return this.expireTime;
	}

	public void setExpireTime(String expireTime) {
		this.expireTime = expireTime;
	}

	public String getLastUpdateTime() {
		return this.lastUpdateTime;
	}

	public void setLastUpdateTime(String lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}

	public String getLastUpdator() {
		return this.lastUpdator;
	}

	public void setLastUpdator(String lastUpdator) {
		this.lastUpdator = lastUpdator;
	}

	public String getParentId() {
		return this.parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getParentNodeName() {
		return this.parentNodeName;
	}

	public void setParentNodeName(String parentNodeName) {
		this.parentNodeName = parentNodeName;
	}

	public int getPriority() {
		return this.priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public String getServiceNo() {
		return this.serviceNo;
	}

	public void setServiceNo(String serviceNo) {
		this.serviceNo = serviceNo;
	}

	public String getVariable() {
		return this.variable;
	}

	public void setVariable(String variable) {
		this.variable = variable;
	}

	public int getVersion() {
		return this.version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public WfmProcess getWfmProcess() {
		return this.wfmProcess;
	}

	public void setWfmProcess(WfmProcess wfmProcess) {
		this.wfmProcess = wfmProcess;
	}

	public List<WfmTask> getWfmTasks() {
		return this.wfmTasks;
	}

	public void setWfmTasks(List<WfmTask> wfmTasks) {
		this.wfmTasks = wfmTasks;
	}

	public WfmTask addWfmTask(WfmTask wfmTask) {
		getWfmTasks().add(wfmTask);
		wfmTask.setWfmService(this);

		return wfmTask;
	}

	public WfmTask removeWfmTask(WfmTask wfmTask) {
		getWfmTasks().remove(wfmTask);
		wfmTask.setWfmService(null);

		return wfmTask;
	}

}